﻿using DAL;
using IBLL;
using IDAL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace Webmember.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MemberController : ControllerBase
    {
        public MemberController(IBll bll)
        {
            Bll = bll;
        }

        public IBll Bll { get; }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param member="t">表名</param>
        /// <returns>返回受影响行数</returns>
        [HttpPost]
        public Task<int> Tian(member member)
        {
            return Bll.Tian(member);
        }
        /// <summary>
        /// 列表显示
        /// </summary>
        /// <returns>返回受影响函数</returns>
        [HttpGet]
        public dynamic Xian()
        {
            return Bll.Xian();
        }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>返回受影响行数</returns>
        [HttpDelete]
        public async Task<int> Del(int id)
        {
            return await Bll.Del(id);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>返回受影响行数</returns>
        [HttpDelete]
        public Task<int> Dele(int dd)
        {
        return Bll.Dele(dd);
        }
    }
}
